package com.cskaoyan.javase.oop1._13block._3static.classload;

/**
 * 读程序题,都从main方法开始
 * @since 14:35
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class TestStaticDemo {
    // 启动main方法,需要先类加载TestStaticDemo这个类
    // 严格来说是进行类初始化
    public static void main(String[] args) {
        staticMethod();
    }

    static TestStaticDemo ts = new TestStaticDemo();

    static {
        System.out.println("静态代码块");
    }

    {
        System.out.println("构造代码块");
    }

    public TestStaticDemo() {
        System.out.println("无参构造器");
        System.out.println("a=" + a + ",b=" + b);
    }

    public static void staticMethod() {
        System.out.println("静态成员方法");
        // System.out.println("b =" + b);
    }

    int a = 666;
    static int b = 777;

    static TestStaticDemo ts2 = new TestStaticDemo();

}